//
//  Particle.m
//  15. Particle System
//
//  Created by iD Student on 7/8/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "Particle.h"

@implementation Particle
@synthesize image, lifetime, velocityX, velocityY;

- (id) init
{
    image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sphere.png"]];
    CGSizeMake(30, 30);
    velocityX = 0;
    velocityY = 0;
    lifetime = 0;
    
    return self;
}

- (BOOL)isAlive
{
    return lifetime > 0;
}

- (void) update
{
    lifetime -- ;
    image.center = CGPointMake(image.center.x + velocityX, image.center.y + velocityY);
}

@end
